﻿using System;
using System.Collections.Generic;
using Helpers;
using TaleWorlds.CampaignSystem.Actions;
using TaleWorlds.CampaignSystem.Conversation;
using TaleWorlds.CampaignSystem.MapEvents;
using TaleWorlds.CampaignSystem.Party;
using TaleWorlds.CampaignSystem.Roster;
using TaleWorlds.CampaignSystem.Settlements;
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.Localization;
using TaleWorlds.SaveSystem;

namespace TaleWorlds.CampaignSystem.Issues
{
	// Token: 0x02000317 RID: 791
	public class MerchantNeedsHelpWithOutlawsIssueQuestBehavior : CampaignBehaviorBase
	{
		// Token: 0x06002D98 RID: 11672 RVA: 0x000BEE66 File Offset: 0x000BD066
		public override void RegisterEvents()
		{
			CampaignEvents.OnCheckForIssueEvent.AddNonSerializedListener(this, new Action<Hero>(this.OnCheckForIssue));
		}

		// Token: 0x06002D99 RID: 11673 RVA: 0x000BEE7F File Offset: 0x000BD07F
		public override void SyncData(IDataStore dataStore)
		{
		}

		// Token: 0x06002D9A RID: 11674 RVA: 0x000BEE84 File Offset: 0x000BD084
		private bool ConditionsHold(Hero issueGiver, out Hideout hideout)
		{
			hideout = null;
			if (issueGiver.IsMerchant || issueGiver.IsRuralNotable)
			{
				Settlement settlement = SettlementHelper.FindNearestHideout((Settlement x) => x.Hideout.IsInfested && !Campaign.Current.BusyHideouts.Contains(x), null);
				if (settlement != null)
				{
					float num;
					Campaign.Current.Models.MapDistanceModel.GetDistance(issueGiver.GetMapPoint(), settlement, 100f, out num);
					if (num < 50f)
					{
						hideout = settlement.Hideout;
						return true;
					}
				}
			}
			return false;
		}

		// Token: 0x06002D9B RID: 11675 RVA: 0x000BEF04 File Offset: 0x000BD104
		public void OnCheckForIssue(Hero hero)
		{
			Hideout relatedObject;
			if (this.ConditionsHold(hero, out relatedObject))
			{
				Campaign.Current.IssueManager.AddPotentialIssueData(hero, new PotentialIssueData(new PotentialIssueData.StartIssueDelegate(this.OnSelected), typeof(MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssue), IssueBase.IssueFrequency.VeryCommon, relatedObject));
				return;
			}
			Campaign.Current.IssueManager.AddPotentialIssueData(hero, new PotentialIssueData(typeof(MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssue), IssueBase.IssueFrequency.VeryCommon));
		}

		// Token: 0x06002D9C RID: 11676 RVA: 0x000BEF6C File Offset: 0x000BD16C
		private IssueBase OnSelected(in PotentialIssueData pid, Hero issueOwner)
		{
			PotentialIssueData potentialIssueData = pid;
			Hideout relatedHideout = potentialIssueData.RelatedObject as Hideout;
			return new MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssue(issueOwner, relatedHideout);
		}

		// Token: 0x04000DA3 RID: 3491
		private const IssueBase.IssueFrequency MerchantNeedsHelpWithOutlawsIssueFrequency = IssueBase.IssueFrequency.VeryCommon;

		// Token: 0x04000DA4 RID: 3492
		private const int ValidBanditPartyDistance = 40;

		// Token: 0x04000DA5 RID: 3493
		private const int NeededHideoutDistanceToSpawnTheQuest = 50;

		// Token: 0x0200065B RID: 1627
		public class MerchantNeedsHelpWithOutlawsIssue : IssueBase
		{
			// Token: 0x060051BD RID: 20925 RVA: 0x0017423A File Offset: 0x0017243A
			internal static void AutoGeneratedStaticCollectObjectsMerchantNeedsHelpWithOutlawsIssue(object o, List<object> collectedObjects)
			{
				((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssue)o).AutoGeneratedInstanceCollectObjects(collectedObjects);
			}

			// Token: 0x060051BE RID: 20926 RVA: 0x00174248 File Offset: 0x00172448
			protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
			{
				base.AutoGeneratedInstanceCollectObjects(collectedObjects);
				collectedObjects.Add(this.RelatedHideout);
			}

			// Token: 0x060051BF RID: 20927 RVA: 0x0017425D File Offset: 0x0017245D
			internal static object AutoGeneratedGetMemberValueRelatedHideout(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssue)o).RelatedHideout;
			}

			// Token: 0x17001133 RID: 4403
			// (get) Token: 0x060051C0 RID: 20928 RVA: 0x0017426A File Offset: 0x0017246A
			public override IssueBase.AlternativeSolutionScaleFlag AlternativeSolutionScaleFlags
			{
				get
				{
					return IssueBase.AlternativeSolutionScaleFlag.Casualties | IssueBase.AlternativeSolutionScaleFlag.FailureRisk;
				}
			}

			// Token: 0x17001134 RID: 4404
			// (get) Token: 0x060051C1 RID: 20929 RVA: 0x0017426E File Offset: 0x0017246E
			private int TotalPartyCount
			{
				get
				{
					return (int)(2f + 6f * base.IssueDifficultyMultiplier);
				}
			}

			// Token: 0x17001135 RID: 4405
			// (get) Token: 0x060051C2 RID: 20930 RVA: 0x00174283 File Offset: 0x00172483
			public override int AlternativeSolutionBaseNeededMenCount
			{
				get
				{
					return 8 + MathF.Ceiling(11f * base.IssueDifficultyMultiplier);
				}
			}

			// Token: 0x17001136 RID: 4406
			// (get) Token: 0x060051C3 RID: 20931 RVA: 0x00174298 File Offset: 0x00172498
			protected override int AlternativeSolutionBaseDurationInDaysInternal
			{
				get
				{
					return 5 + MathF.Ceiling(7f * base.IssueDifficultyMultiplier);
				}
			}

			// Token: 0x17001137 RID: 4407
			// (get) Token: 0x060051C4 RID: 20932 RVA: 0x001742AD File Offset: 0x001724AD
			protected override int RewardGold
			{
				get
				{
					return (int)(400f + 1500f * base.IssueDifficultyMultiplier);
				}
			}

			// Token: 0x17001138 RID: 4408
			// (get) Token: 0x060051C5 RID: 20933 RVA: 0x001742C2 File Offset: 0x001724C2
			public override TextObject IssueBriefByIssueGiver
			{
				get
				{
					return new TextObject("{=ib6ltlM0}Yes... We've always had trouble with bandits, but recently we've had a lot more than our share. The hills outside of town are infested. A lot of us are afraid to take their goods to market. Some have been murdered. People tell me, 'I'm getting so desperate, maybe I'll turn bandit myself.' It's bad...[ib:demure2][if:convo_dismayed]", null);
				}
			}

			// Token: 0x17001139 RID: 4409
			// (get) Token: 0x060051C6 RID: 20934 RVA: 0x001742CF File Offset: 0x001724CF
			public override TextObject IssueAcceptByPlayer
			{
				get
				{
					return new TextObject("{=qNxdWLFY}So you want me to hunt them down?", null);
				}
			}

			// Token: 0x1700113A RID: 4410
			// (get) Token: 0x060051C7 RID: 20935 RVA: 0x001742DC File Offset: 0x001724DC
			public override TextObject IssueQuestSolutionExplanationByIssueGiver
			{
				get
				{
					TextObject textObject = new TextObject("{=DlRMT7XD}Well, {?PLAYER.GENDER}my lady{?}sir{\\?}, you'll never get all those outlaws,[if:convo_thinking] but if word gets around that you took down some of the most vicious ones - let's say {TOTAL_COUNT} bands of brigands - robbing us wouldn't seem so lucrative. Maybe the rest would go bother someone else... Do you think you can help us?", null);
					StringHelpers.SetCharacterProperties("PLAYER", CharacterObject.PlayerCharacter, textObject, false);
					textObject.SetTextVariable("TOTAL_COUNT", this.TotalPartyCount);
					return textObject;
				}
			}

			// Token: 0x1700113B RID: 4411
			// (get) Token: 0x060051C8 RID: 20936 RVA: 0x0017431A File Offset: 0x0017251A
			public override TextObject IssueAlternativeSolutionExplanationByIssueGiver
			{
				get
				{
					TextObject textObject = new TextObject("{=5RjvnQ3d}I bet even a party of {ALTERNATIVE_COUNT} properly trained men accompanied by one of your lieutenants can handle any band they find. Give them {TOTAL_DAYS} days, say... That will make a difference.[if:convo_undecided_open]", null);
					textObject.SetTextVariable("ALTERNATIVE_COUNT", base.GetTotalAlternativeSolutionNeededMenCount());
					textObject.SetTextVariable("TOTAL_DAYS", base.GetTotalAlternativeSolutionDurationInDays());
					return textObject;
				}
			}

			// Token: 0x1700113C RID: 4412
			// (get) Token: 0x060051C9 RID: 20937 RVA: 0x0017434B File Offset: 0x0017254B
			public override TextObject IssuePlayerResponseAfterAlternativeExplanation
			{
				get
				{
					return new TextObject("{=BPfuSkCl}That depends. How many men do you think are required to get the job done?", null);
				}
			}

			// Token: 0x1700113D RID: 4413
			// (get) Token: 0x060051CA RID: 20938 RVA: 0x00174358 File Offset: 0x00172558
			public override TextObject IssueQuestSolutionAcceptByPlayer
			{
				get
				{
					TextObject textObject = new TextObject("{=2ApU6iCB}I'll hunt down {TOTAL_COUNT} bands of brigands for you.", null);
					textObject.SetTextVariable("TOTAL_COUNT", this.TotalPartyCount);
					return textObject;
				}
			}

			// Token: 0x1700113E RID: 4414
			// (get) Token: 0x060051CB RID: 20939 RVA: 0x00174377 File Offset: 0x00172577
			public override TextObject IssueAlternativeSolutionAcceptByPlayer
			{
				get
				{
					TextObject textObject = new TextObject("{=DLbFbYkR}I will have one of my companions and {ALTERNATIVE_COUNT} of my men patrol the area for {TOTAL_DAYS} days.", null);
					textObject.SetTextVariable("ALTERNATIVE_COUNT", base.GetTotalAlternativeSolutionNeededMenCount());
					textObject.SetTextVariable("TOTAL_DAYS", base.GetTotalAlternativeSolutionDurationInDays());
					return textObject;
				}
			}

			// Token: 0x1700113F RID: 4415
			// (get) Token: 0x060051CC RID: 20940 RVA: 0x001743A8 File Offset: 0x001725A8
			public override TextObject IssueDiscussAlternativeSolution
			{
				get
				{
					return new TextObject("{=PexmGuOd}{?PLAYER.GENDER}Madam{?}Sir{\\?}, I am happy to tell that the men you left are patrolling, and already we feel safer. Thank you again.[ib:demure][if:convo_grateful]", null);
				}
			}

			// Token: 0x17001140 RID: 4416
			// (get) Token: 0x060051CD RID: 20941 RVA: 0x001743B8 File Offset: 0x001725B8
			public override TextObject IssueAlternativeSolutionResponseByIssueGiver
			{
				get
				{
					TextObject textObject = new TextObject("{=FYfZFve3}Thank you, {?PLAYER.GENDER}my lady{?}my lord{\\?}. Hopefully, we can travel safely again.", null);
					StringHelpers.SetCharacterProperties("PLAYER", CharacterObject.PlayerCharacter, textObject, false);
					return textObject;
				}
			}

			// Token: 0x17001141 RID: 4417
			// (get) Token: 0x060051CE RID: 20942 RVA: 0x001743E4 File Offset: 0x001725E4
			public override bool IsThereAlternativeSolution
			{
				get
				{
					return true;
				}
			}

			// Token: 0x17001142 RID: 4418
			// (get) Token: 0x060051CF RID: 20943 RVA: 0x001743E7 File Offset: 0x001725E7
			public override bool IsThereLordSolution
			{
				get
				{
					return false;
				}
			}

			// Token: 0x17001143 RID: 4419
			// (get) Token: 0x060051D0 RID: 20944 RVA: 0x001743EA File Offset: 0x001725EA
			protected override int CompanionSkillRewardXP
			{
				get
				{
					return (int)(600f + 800f * base.IssueDifficultyMultiplier);
				}
			}

			// Token: 0x17001144 RID: 4420
			// (get) Token: 0x060051D1 RID: 20945 RVA: 0x00174400 File Offset: 0x00172600
			protected override TextObject AlternativeSolutionStartLog
			{
				get
				{
					TextObject textObject = new TextObject("{=Bdt41knf}You have accepted {QUEST_GIVER.LINK}'s request to find at least {TOTAL_COUNT} different parties of brigands around {QUEST_SETTLEMENT} and sent {COMPANION.LINK} and with {?COMPANION.GENDER}her{?}his{\\?} {ALTERNATIVE_COUNT} of your men to deal with them. They should return with the reward of {GOLD_AMOUNT}{GOLD_ICON} denars as promised by {QUEST_GIVER.LINK} after dealing with them in {RETURN_DAYS} days.", null);
					textObject.SetTextVariable("TOTAL_COUNT", this.TotalPartyCount);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.IssueOwner.CharacterObject, textObject, false);
					StringHelpers.SetCharacterProperties("COMPANION", base.AlternativeSolutionHero.CharacterObject, textObject, false);
					textObject.SetTextVariable("QUEST_SETTLEMENT", base.IssueOwner.CurrentSettlement.EncyclopediaLinkWithName);
					textObject.SetTextVariable("ALTERNATIVE_COUNT", this.AlternativeSolutionSentTroops.TotalManCount - 1);
					textObject.SetTextVariable("GOLD_AMOUNT", this.RewardGold);
					textObject.SetTextVariable("GOLD_ICON", "{=!}<img src=\"General\\Icons\\Coin@2x\" extend=\"8\">");
					textObject.SetTextVariable("RETURN_DAYS", base.GetTotalAlternativeSolutionDurationInDays());
					return textObject;
				}
			}

			// Token: 0x17001145 RID: 4421
			// (get) Token: 0x060051D2 RID: 20946 RVA: 0x001744C8 File Offset: 0x001726C8
			public override TextObject Title
			{
				get
				{
					TextObject textObject = new TextObject("{=ABmCO23x}{QUEST_GIVER.NAME} Needs Help With Brigands", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.IssueOwner.CharacterObject, textObject, false);
					return textObject;
				}
			}

			// Token: 0x17001146 RID: 4422
			// (get) Token: 0x060051D3 RID: 20947 RVA: 0x001744FA File Offset: 0x001726FA
			public override TextObject Description
			{
				get
				{
					return new TextObject("{=sAobCa9U}Brigands are disturbing travelers outside the town. Someone needs to hunt them down.", null);
				}
			}

			// Token: 0x060051D4 RID: 20948 RVA: 0x00174507 File Offset: 0x00172707
			public MerchantNeedsHelpWithOutlawsIssue(Hero issueOwner, Hideout relatedHideout) : base(issueOwner, CampaignTime.DaysFromNow(15f))
			{
				this.RelatedHideout = relatedHideout;
				Campaign.Current.BusyHideouts.Add(relatedHideout.Settlement);
			}

			// Token: 0x060051D5 RID: 20949 RVA: 0x00174536 File Offset: 0x00172736
			protected override float GetIssueEffectAmountInternal(IssueEffect issueEffect)
			{
				if (issueEffect == DefaultIssueEffects.SettlementProsperity)
				{
					return -0.2f;
				}
				if (issueEffect == DefaultIssueEffects.IssueOwnerPower)
				{
					return -0.1f;
				}
				if (issueEffect == DefaultIssueEffects.SettlementSecurity)
				{
					return -1f;
				}
				return 0f;
			}

			// Token: 0x060051D6 RID: 20950 RVA: 0x00174567 File Offset: 0x00172767
			public override ValueTuple<SkillObject, int> GetAlternativeSolutionSkill(Hero hero)
			{
				return new ValueTuple<SkillObject, int>((hero.GetSkillValue(DefaultSkills.Tactics) >= hero.GetSkillValue(DefaultSkills.Scouting)) ? DefaultSkills.Tactics : DefaultSkills.Scouting, 120);
			}

			// Token: 0x060051D7 RID: 20951 RVA: 0x00174594 File Offset: 0x00172794
			public override bool DoTroopsSatisfyAlternativeSolution(TroopRoster troopRoster, out TextObject explanation)
			{
				explanation = TextObject.Empty;
				return QuestHelper.CheckRosterForAlternativeSolution(troopRoster, base.GetTotalAlternativeSolutionNeededMenCount(), ref explanation, 2, false);
			}

			// Token: 0x060051D8 RID: 20952 RVA: 0x001745AC File Offset: 0x001727AC
			public override bool AlternativeSolutionCondition(out TextObject explanation)
			{
				explanation = TextObject.Empty;
				return QuestHelper.CheckRosterForAlternativeSolution(MobileParty.MainParty.MemberRoster, base.GetTotalAlternativeSolutionNeededMenCount(), ref explanation, 2, false);
			}

			// Token: 0x060051D9 RID: 20953 RVA: 0x001745CD File Offset: 0x001727CD
			public override bool IsTroopTypeNeededByAlternativeSolution(CharacterObject character)
			{
				return character.Tier >= 2;
			}

			// Token: 0x060051DA RID: 20954 RVA: 0x001745DC File Offset: 0x001727DC
			protected override void AlternativeSolutionEndWithSuccessConsequence()
			{
				this.RelationshipChangeWithIssueOwner = 3;
				if (base.IssueOwner.CurrentSettlement.IsVillage && base.IssueOwner.CurrentSettlement.Village.TradeBound != null)
				{
					base.IssueOwner.CurrentSettlement.Village.Bound.Town.Security += 5f;
					base.IssueOwner.CurrentSettlement.Village.Bound.Town.Prosperity += 5f;
				}
				else if (base.IssueOwner.CurrentSettlement.IsTown)
				{
					base.IssueOwner.CurrentSettlement.Town.Security += 5f;
					base.IssueOwner.CurrentSettlement.Town.Prosperity += 5f;
				}
				Hero.MainHero.Clan.AddRenown(1f, true);
			}

			// Token: 0x060051DB RID: 20955 RVA: 0x001746DC File Offset: 0x001728DC
			protected override void AlternativeSolutionEndWithFailureConsequence()
			{
				if (base.IssueOwner.CurrentSettlement.IsVillage)
				{
					base.IssueOwner.CurrentSettlement.Village.Bound.Town.Prosperity -= 10f;
				}
				else if (base.IssueOwner.CurrentSettlement.IsTown)
				{
					base.IssueOwner.CurrentSettlement.Town.Prosperity -= 10f;
				}
				this.RelationshipChangeWithIssueOwner = -5;
			}

			// Token: 0x060051DC RID: 20956 RVA: 0x00174763 File Offset: 0x00172963
			public override IssueBase.IssueFrequency GetFrequency()
			{
				return IssueBase.IssueFrequency.VeryCommon;
			}

			// Token: 0x060051DD RID: 20957 RVA: 0x00174768 File Offset: 0x00172968
			protected override bool CanPlayerTakeQuestConditions(Hero issueGiver, out IssueBase.PreconditionFlags flag, out Hero relationHero, out SkillObject skill)
			{
				flag = IssueBase.PreconditionFlags.None;
				relationHero = null;
				skill = null;
				if (issueGiver.GetRelationWithPlayer() < -10f)
				{
					flag |= IssueBase.PreconditionFlags.Relation;
					relationHero = issueGiver;
				}
				if (MobileParty.MainParty.MemberRoster.TotalHealthyCount < 5)
				{
					flag |= IssueBase.PreconditionFlags.NotEnoughTroops;
				}
				if (issueGiver.MapFaction.IsAtWarWith(Hero.MainHero.MapFaction))
				{
					flag |= IssueBase.PreconditionFlags.AtWar;
				}
				return flag == IssueBase.PreconditionFlags.None;
			}

			// Token: 0x060051DE RID: 20958 RVA: 0x001747D4 File Offset: 0x001729D4
			public override bool IssueStayAliveConditions()
			{
				return !base.IssueOwner.CurrentSettlement.IsRaided && !base.IssueOwner.CurrentSettlement.IsUnderRaid && this.RelatedHideout != null && this.RelatedHideout.IsInfested;
			}

			// Token: 0x060051DF RID: 20959 RVA: 0x00174810 File Offset: 0x00172A10
			protected override void OnGameLoad()
			{
				if (MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.2.9", 54620))
				{
					if (this.RelatedHideout == null)
					{
						base.CompleteIssueWithCancel(null);
						return;
					}
					if (!Campaign.Current.BusyHideouts.Contains(this.RelatedHideout.Settlement))
					{
						Campaign.Current.BusyHideouts.Add(this.RelatedHideout.Settlement);
					}
				}
			}

			// Token: 0x060051E0 RID: 20960 RVA: 0x00174885 File Offset: 0x00172A85
			protected override void HourlyTick()
			{
			}

			// Token: 0x060051E1 RID: 20961 RVA: 0x00174887 File Offset: 0x00172A87
			protected override QuestBase GenerateIssueQuest(string questId)
			{
				return new MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest(questId, base.IssueOwner, CampaignTime.DaysFromNow(20f), this.RewardGold, this.TotalPartyCount, this.RelatedHideout);
			}

			// Token: 0x060051E2 RID: 20962 RVA: 0x001748B1 File Offset: 0x00172AB1
			protected override void CompleteIssueWithTimedOutConsequences()
			{
			}

			// Token: 0x060051E3 RID: 20963 RVA: 0x001748B3 File Offset: 0x00172AB3
			protected override void OnIssueFinalized()
			{
				if (this.RelatedHideout != null)
				{
					Campaign.Current.BusyHideouts.Remove(this.RelatedHideout.Settlement);
				}
			}

			// Token: 0x04001AB1 RID: 6833
			private const int IssueDuration = 15;

			// Token: 0x04001AB2 RID: 6834
			private const int QuestTimeLimit = 20;

			// Token: 0x04001AB3 RID: 6835
			private const int MinimumRequiredMenCount = 5;

			// Token: 0x04001AB4 RID: 6836
			private const int AlternativeSolutionMinimumSkillValue = 120;

			// Token: 0x04001AB5 RID: 6837
			private const int AlternativeSolutionTroopTierRequirement = 2;

			// Token: 0x04001AB6 RID: 6838
			[SaveableField(10)]
			private Hideout RelatedHideout;
		}

		// Token: 0x0200065C RID: 1628
		public class MerchantNeedsHelpWithOutlawsIssueQuest : QuestBase
		{
			// Token: 0x060051E4 RID: 20964 RVA: 0x001748D8 File Offset: 0x00172AD8
			internal static void AutoGeneratedStaticCollectObjectsMerchantNeedsHelpWithOutlawsIssueQuest(object o, List<object> collectedObjects)
			{
				((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o).AutoGeneratedInstanceCollectObjects(collectedObjects);
			}

			// Token: 0x060051E5 RID: 20965 RVA: 0x001748E6 File Offset: 0x00172AE6
			protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
			{
				base.AutoGeneratedInstanceCollectObjects(collectedObjects);
				collectedObjects.Add(this._validPartiesList);
				collectedObjects.Add(this._relatedHideout);
				collectedObjects.Add(this._questProgressLogTest);
			}

			// Token: 0x060051E6 RID: 20966 RVA: 0x00174913 File Offset: 0x00172B13
			internal static object AutoGeneratedGetMemberValue_totalPartyCount(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o)._totalPartyCount;
			}

			// Token: 0x060051E7 RID: 20967 RVA: 0x00174925 File Offset: 0x00172B25
			internal static object AutoGeneratedGetMemberValue_destroyedPartyCount(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o)._destroyedPartyCount;
			}

			// Token: 0x060051E8 RID: 20968 RVA: 0x00174937 File Offset: 0x00172B37
			internal static object AutoGeneratedGetMemberValue_recruitedPartyCount(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o)._recruitedPartyCount;
			}

			// Token: 0x060051E9 RID: 20969 RVA: 0x00174949 File Offset: 0x00172B49
			internal static object AutoGeneratedGetMemberValue_validPartiesList(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o)._validPartiesList;
			}

			// Token: 0x060051EA RID: 20970 RVA: 0x00174956 File Offset: 0x00172B56
			internal static object AutoGeneratedGetMemberValue_relatedHideout(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o)._relatedHideout;
			}

			// Token: 0x060051EB RID: 20971 RVA: 0x00174963 File Offset: 0x00172B63
			internal static object AutoGeneratedGetMemberValue_questProgressLogTest(object o)
			{
				return ((MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest)o)._questProgressLogTest;
			}

			// Token: 0x17001147 RID: 4423
			// (get) Token: 0x060051EC RID: 20972 RVA: 0x00174970 File Offset: 0x00172B70
			public override TextObject Title
			{
				get
				{
					TextObject textObject = new TextObject("{=PBGiIbEM}{ISSUE_GIVER.NAME} Needs Help With Brigands", null);
					StringHelpers.SetCharacterProperties("ISSUE_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					return textObject;
				}
			}

			// Token: 0x17001148 RID: 4424
			// (get) Token: 0x060051ED RID: 20973 RVA: 0x001749A2 File Offset: 0x00172BA2
			public override bool IsRemainingTimeHidden
			{
				get
				{
					return false;
				}
			}

			// Token: 0x17001149 RID: 4425
			// (get) Token: 0x060051EE RID: 20974 RVA: 0x001749A5 File Offset: 0x00172BA5
			private int _questPartyProgress
			{
				get
				{
					return this._destroyedPartyCount + this._recruitedPartyCount;
				}
			}

			// Token: 0x1700114A RID: 4426
			// (get) Token: 0x060051EF RID: 20975 RVA: 0x001749B4 File Offset: 0x00172BB4
			private TextObject _playerStartsQuestLogText
			{
				get
				{
					TextObject textObject = new TextObject("{=6iLxrDBa}You have accepted {QUEST_GIVER.LINK}'s request to find at least {TOTAL_COUNT} different parties of brigands around {QUEST_SETTLEMENT} and decided to hunt them down personally. {?QUEST_GIVER.GENDER}She{?}He{\\?} will reward you {AMOUNT}{GOLD_ICON} gold once you have dealt with them.", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					textObject.SetTextVariable("TOTAL_COUNT", this._totalPartyCount);
					textObject.SetTextVariable("QUEST_SETTLEMENT", base.QuestGiver.CurrentSettlement.EncyclopediaLinkWithName);
					textObject.SetTextVariable("AMOUNT", this.RewardGold);
					textObject.SetTextVariable("GOLD_ICON", "{=!}<img src=\"General\\Icons\\Coin@2x\" extend=\"8\">");
					return textObject;
				}
			}

			// Token: 0x1700114B RID: 4427
			// (get) Token: 0x060051F0 RID: 20976 RVA: 0x00174A38 File Offset: 0x00172C38
			private TextObject _successQuestLogText1
			{
				get
				{
					TextObject textObject = new TextObject("{=cQ6CzXKM}You have defeated all the brigands as {QUEST_GIVER.LINK} has asked. {?QUEST_GIVER.GENDER}She{?}He{\\?} is grateful. And sends you the reward, {GOLD_AMOUNT}{GOLD_ICON} gold as promised.", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					textObject.SetTextVariable("SETTLEMENT", base.QuestGiver.CurrentSettlement.Name);
					textObject.SetTextVariable("GOLD_AMOUNT", this.RewardGold);
					textObject.SetTextVariable("GOLD_ICON", "{=!}<img src=\"General\\Icons\\Coin@2x\" extend=\"8\">");
					return textObject;
				}
			}

			// Token: 0x1700114C RID: 4428
			// (get) Token: 0x060051F1 RID: 20977 RVA: 0x00174AAC File Offset: 0x00172CAC
			private TextObject _successQuestLogText2
			{
				get
				{
					TextObject textObject = new TextObject("{=dSHgU9gD}You have defeated some of the brigands and recruited the rest into your party. {QUEST_GIVER.LINK} is grateful and sends you the {GOLD_AMOUNT}{GOLD_ICON} as promised. ", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					textObject.SetTextVariable("GOLD_AMOUNT", this.RewardGold);
					textObject.SetTextVariable("GOLD_ICON", "{=!}<img src=\"General\\Icons\\Coin@2x\" extend=\"8\">");
					return textObject;
				}
			}

			// Token: 0x1700114D RID: 4429
			// (get) Token: 0x060051F2 RID: 20978 RVA: 0x00174B04 File Offset: 0x00172D04
			private TextObject _successQuestLogText3
			{
				get
				{
					TextObject textObject = new TextObject("{=3V5udYJO}You have recruited the brigands into your party. {QUEST_GIVER.LINK} finds your solution acceptable and sends you the {GOLD_AMOUNT}{GOLD_ICON} as promised.", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					textObject.SetTextVariable("GOLD_AMOUNT", this.RewardGold);
					textObject.SetTextVariable("GOLD_ICON", "{=!}<img src=\"General\\Icons\\Coin@2x\" extend=\"8\">");
					return textObject;
				}
			}

			// Token: 0x1700114E RID: 4430
			// (get) Token: 0x060051F3 RID: 20979 RVA: 0x00174B5C File Offset: 0x00172D5C
			private TextObject _timeoutLog
			{
				get
				{
					TextObject textObject = new TextObject("{=Tcux6Sru}You have failed to defeat all {TOTAL_COUNT} outlaw parties in time as {QUEST_GIVER.LINK} asked. {?QUEST_GIVER.GENDER}She{?}He{\\?} is very disappointed.", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					textObject.SetTextVariable("TOTAL_COUNT", this._totalPartyCount);
					return textObject;
				}
			}

			// Token: 0x1700114F RID: 4431
			// (get) Token: 0x060051F4 RID: 20980 RVA: 0x00174BA0 File Offset: 0x00172DA0
			private TextObject _questGiverVillageRaided
			{
				get
				{
					TextObject textObject = new TextObject("{=4rCIZ6e5}{QUEST_SETTLEMENT} was raided, Your agreement with {QUEST_GIVER.LINK} is canceled.", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					textObject.SetTextVariable("QUEST_SETTLEMENT", base.QuestGiver.CurrentSettlement.EncyclopediaLinkWithName);
					return textObject;
				}
			}

			// Token: 0x17001150 RID: 4432
			// (get) Token: 0x060051F5 RID: 20981 RVA: 0x00174BF0 File Offset: 0x00172DF0
			private TextObject _questCanceledWarDeclaredLog
			{
				get
				{
					TextObject textObject = new TextObject("{=vW6kBki9}Your clan is now at war with {QUEST_GIVER.LINK}'s realm. Your agreement with {QUEST_GIVER.LINK} is canceled.", null);
					StringHelpers.SetCharacterProperties("QUEST_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					return textObject;
				}
			}

			// Token: 0x17001151 RID: 4433
			// (get) Token: 0x060051F6 RID: 20982 RVA: 0x00174C24 File Offset: 0x00172E24
			private TextObject _playerDeclaredWarQuestLogText
			{
				get
				{
					TextObject textObject = new TextObject("{=DDur6mHb}Your actions have started a war with {ISSUE_GIVER.LINK}'s faction. Your agreement with {ISSUE_GIVER.LINK} is failed.", null);
					StringHelpers.SetCharacterProperties("ISSUE_GIVER", base.QuestGiver.CharacterObject, textObject, false);
					return textObject;
				}
			}

			// Token: 0x060051F7 RID: 20983 RVA: 0x00174C58 File Offset: 0x00172E58
			public MerchantNeedsHelpWithOutlawsIssueQuest(string questId, Hero giverHero, CampaignTime duration, int rewardGold, int totalPartyCount, Hideout relatedHideout) : base(questId, giverHero, duration, rewardGold)
			{
				this._totalPartyCount = totalPartyCount;
				this._destroyedPartyCount = 0;
				this._recruitedPartyCount = 0;
				this._validPartiesList = new List<MobileParty>();
				this._relatedHideout = relatedHideout;
				Campaign.Current.BusyHideouts.Add(relatedHideout.Settlement);
				this.AddHideoutPartiesToValidPartiesList();
				this.SetDialogs();
				base.InitializeQuestOnCreation();
			}

			// Token: 0x060051F8 RID: 20984 RVA: 0x00174CC4 File Offset: 0x00172EC4
			protected override void SetDialogs()
			{
				TextObject textObject = new TextObject("{=PQIYPCDn}Very good. I will be waiting for the good news then. Once you return, I'm ready to offer a reward of {REWARD_GOLD}{GOLD_ICON} denars. Just make sure that you defeat at least {TROOP_COUNT} bands no more than a day's ride away from here.[ib:normal][if:convo_bemused]", null);
				textObject.SetTextVariable("REWARD_GOLD", this.RewardGold);
				textObject.SetTextVariable("TROOP_COUNT", this._totalPartyCount);
				textObject.SetTextVariable("GOLD_ICON", "{=!}<img src=\"General\\Icons\\Coin@2x\" extend=\"8\">");
				this.OfferDialogFlow = DialogFlow.CreateDialogFlow("issue_classic_quest_start", 100).NpcLine(textObject, null, null).Condition(() => Hero.OneToOneConversationHero == base.QuestGiver).Consequence(new ConversationSentence.OnConsequenceDelegate(this.QuestAcceptedConsequences)).CloseDialog();
				this.DiscussDialogFlow = DialogFlow.CreateDialogFlow("quest_discuss", 100).NpcLine(new TextObject("{=jjTcNhKE}Have you been able to find any bandits yet?[if:convo_undecided_open]", null), null, null).Condition(() => Hero.OneToOneConversationHero == base.QuestGiver).BeginPlayerOptions().PlayerOption(new TextObject("{=mU45Th70}We're off to hunt them now.", null), null).NpcLine(new TextObject("{=u9vtceCV}You are a savior.[if:convo_astonished]", null), null, null).CloseDialog().Condition(() => Hero.OneToOneConversationHero == base.QuestGiver).PlayerOption(new TextObject("{=QPv1b7f8}I haven't had the time yet.", null), null).NpcLine(new TextObject("{=6ba4n9n6}We are waiting for your good news {?PLAYER.GENDER}my lady{?}sir{\\?}.[if:convo_focused_happy]", null), null, null).CloseDialog().Condition(() => Hero.OneToOneConversationHero == base.QuestGiver).EndPlayerOptions().CloseDialog();
			}

			// Token: 0x060051F9 RID: 20985 RVA: 0x00174E09 File Offset: 0x00173009
			private void QuestAcceptedConsequences()
			{
				base.StartQuest();
				this._questProgressLogTest = base.AddDiscreteLog(this._playerStartsQuestLogText, new TextObject("{=HzcLsnYn}Destroyed parties", null), this._destroyedPartyCount, this._totalPartyCount, null, true);
			}

			// Token: 0x060051FA RID: 20986 RVA: 0x00174E3C File Offset: 0x0017303C
			private void AddQuestStepLog()
			{
				this._questProgressLogTest.UpdateCurrentProgress(this._questPartyProgress);
				if (this._questPartyProgress >= this._totalPartyCount)
				{
					this.SuccessConsequences();
					return;
				}
				TextObject textObject = new TextObject("{=xbVCRbUu}You hunted {CURRENT_COUNT}/{TOTAL_COUNT} gang of brigands.", null);
				textObject.SetTextVariable("CURRENT_COUNT", this._questPartyProgress);
				textObject.SetTextVariable("TOTAL_COUNT", this._totalPartyCount);
				MBInformationManager.AddQuickInformation(textObject, 0, null, "");
			}

			// Token: 0x060051FB RID: 20987 RVA: 0x00174EAA File Offset: 0x001730AA
			protected override void HourlyTick()
			{
			}

			// Token: 0x060051FC RID: 20988 RVA: 0x00174EAC File Offset: 0x001730AC
			protected override void RegisterEvents()
			{
				CampaignEvents.HourlyTickPartyEvent.AddNonSerializedListener(this, new Action<MobileParty>(this.HourlyTickParty));
				CampaignEvents.MobilePartyDestroyed.AddNonSerializedListener(this, new Action<MobileParty, PartyBase>(this.MobilePartyDestroyed));
				CampaignEvents.WarDeclared.AddNonSerializedListener(this, new Action<IFaction, IFaction, DeclareWarAction.DeclareWarDetail>(this.OnWarDeclared));
				CampaignEvents.OnClanChangedKingdomEvent.AddNonSerializedListener(this, new Action<Clan, Kingdom, Kingdom, ChangeKingdomAction.ChangeKingdomActionDetail, bool>(this.OnClanChangedKingdom));
				CampaignEvents.VillageBeingRaided.AddNonSerializedListener(this, new Action<Village>(this.OnVillageRaided));
				CampaignEvents.MapEventStarted.AddNonSerializedListener(this, new Action<MapEvent, PartyBase, PartyBase>(this.OnMapEventStarted));
				CampaignEvents.BanditPartyRecruited.AddNonSerializedListener(this, new Action<MobileParty>(this.OnBanditPartyRecruited));
				CampaignEvents.SettlementEntered.AddNonSerializedListener(this, new Action<MobileParty, Settlement, Hero>(this.OnSettlementEntered));
				CampaignEvents.OnSettlementLeftEvent.AddNonSerializedListener(this, new Action<MobileParty, Settlement>(this.OnSettlementLeft));
				CampaignEvents.OnGameLoadFinishedEvent.AddNonSerializedListener(this, new Action(this.OnGameLoadFinished));
			}

			// Token: 0x060051FD RID: 20989 RVA: 0x00174FA0 File Offset: 0x001731A0
			private void OnGameLoadFinished()
			{
				if (this._relatedHideout == null)
				{
					Settlement settlement = SettlementHelper.FindNearestHideout((Settlement x) => x.Hideout.IsInfested, null);
					if (settlement != null)
					{
						float num;
						Campaign.Current.Models.MapDistanceModel.GetDistance(base.QuestGiver.CurrentSettlement, settlement, 100f, out num);
						if (num < 50f)
						{
							this._relatedHideout = settlement.Hideout;
						}
					}
					if (this._relatedHideout != null)
					{
						this.AddHideoutPartiesToValidPartiesList();
					}
					else
					{
						base.CompleteQuestWithCancel(null);
					}
				}
				if (this._relatedHideout != null && base.IsOngoing && MBSaveLoad.IsUpdatingGameVersion && MBSaveLoad.LastLoadedGameVersion < ApplicationVersion.FromString("v1.2.9", 54620))
				{
					if (!Campaign.Current.BusyHideouts.Contains(this._relatedHideout.Settlement))
					{
						Campaign.Current.BusyHideouts.Add(this._relatedHideout.Settlement);
						return;
					}
					base.CompleteQuestWithCancel(null);
					Campaign.Current.BusyHideouts.Add(this._relatedHideout.Settlement);
				}
			}

			// Token: 0x060051FE RID: 20990 RVA: 0x001750C0 File Offset: 0x001732C0
			private void AddHideoutPartiesToValidPartiesList()
			{
				foreach (MobileParty mobileParty in this._relatedHideout.Settlement.Parties)
				{
					if (mobileParty.IsBandit)
					{
						this._validPartiesList.Add(mobileParty);
					}
				}
			}

			// Token: 0x060051FF RID: 20991 RVA: 0x0017512C File Offset: 0x0017332C
			private void OnSettlementLeft(MobileParty party, Settlement settlement)
			{
				if (this._validPartiesList.Contains(party) && settlement.IsHideout && settlement.Hideout == this._relatedHideout)
				{
					this._validPartiesList.Remove(party);
				}
			}

			// Token: 0x06005200 RID: 20992 RVA: 0x0017515F File Offset: 0x0017335F
			private void OnSettlementEntered(MobileParty party, Settlement settlement, Hero hero)
			{
				if (party != null && party.IsBandit && settlement.IsHideout && settlement.Hideout == this._relatedHideout)
				{
					this._validPartiesList.Add(party);
				}
			}

			// Token: 0x06005201 RID: 20993 RVA: 0x0017518E File Offset: 0x0017338E
			private void OnBanditPartyRecruited(MobileParty banditParty)
			{
				if (this._validPartiesList.Contains(banditParty))
				{
					this._recruitedPartyCount++;
					this._validPartiesList.Remove(banditParty);
					this.AddQuestStepLog();
				}
			}

			// Token: 0x06005202 RID: 20994 RVA: 0x001751BF File Offset: 0x001733BF
			private void OnMapEventStarted(MapEvent mapEvent, PartyBase attackerParty, PartyBase defenderParty)
			{
				if (QuestHelper.CheckMinorMajorCoercion(this, mapEvent, attackerParty))
				{
					QuestHelper.ApplyGenericMinorMajorCoercionConsequences(this, mapEvent);
				}
			}

			// Token: 0x06005203 RID: 20995 RVA: 0x001751D2 File Offset: 0x001733D2
			private void OnVillageRaided(Village village)
			{
				if (village == base.QuestGiver.CurrentSettlement.Village)
				{
					base.AddLog(this._questGiverVillageRaided, false);
					base.CompleteQuestWithCancel(null);
				}
			}

			// Token: 0x06005204 RID: 20996 RVA: 0x001751FC File Offset: 0x001733FC
			private void OnClanChangedKingdom(Clan clan, Kingdom oldKingdom, Kingdom newKingdom, ChangeKingdomAction.ChangeKingdomActionDetail detail, bool showNotification = true)
			{
				if (base.QuestGiver.CurrentSettlement.MapFaction.IsAtWarWith(Hero.MainHero.MapFaction))
				{
					base.CompleteQuestWithCancel(this._questCanceledWarDeclaredLog);
				}
			}

			// Token: 0x06005205 RID: 20997 RVA: 0x0017522B File Offset: 0x0017342B
			private void OnWarDeclared(IFaction faction1, IFaction faction2, DeclareWarAction.DeclareWarDetail detail)
			{
				QuestHelper.CheckWarDeclarationAndFailOrCancelTheQuest(this, faction1, faction2, detail, this._playerDeclaredWarQuestLogText, this._questCanceledWarDeclaredLog, false);
			}

			// Token: 0x06005206 RID: 20998 RVA: 0x00175243 File Offset: 0x00173443
			private void MobilePartyDestroyed(MobileParty mobileParty, PartyBase destroyerParty)
			{
				if (destroyerParty == PartyBase.MainParty && this._validPartiesList.Contains(mobileParty))
				{
					this._destroyedPartyCount++;
					this.AddQuestStepLog();
				}
			}

			// Token: 0x06005207 RID: 20999 RVA: 0x00175270 File Offset: 0x00173470
			private void HourlyTickParty(MobileParty mobileParty)
			{
				if (base.IsOngoing && mobileParty.IsBandit && mobileParty.MapEvent == null && mobileParty.MapFaction.IsBanditFaction && !mobileParty.IsCurrentlyUsedByAQuest)
				{
					if (mobileParty.Position2D.DistanceSquared(base.QuestGiver.CurrentSettlement.Position2D) <= 1600f)
					{
						if (!this._validPartiesList.Contains(mobileParty))
						{
							if (!base.IsTracked(mobileParty))
							{
								base.AddTrackedObject(mobileParty);
							}
							this._validPartiesList.Add(mobileParty);
							if (mobileParty.CurrentSettlement == null && MBRandom.RandomFloat < 1f / (float)this._validPartiesList.Count)
							{
								SetPartyAiAction.GetActionForPatrollingAroundSettlement(mobileParty, base.QuestGiver.CurrentSettlement);
								mobileParty.Ai.SetDoNotMakeNewDecisions(true);
								mobileParty.IgnoreForHours(500f);
								return;
							}
						}
						else if (MBRandom.RandomFloat < 0.2f)
						{
							mobileParty.Ai.SetDoNotMakeNewDecisions(false);
							return;
						}
					}
					else if (base.IsTracked(mobileParty))
					{
						base.RemoveTrackedObject(mobileParty);
						this._validPartiesList.Remove(mobileParty);
						mobileParty.Ai.SetDoNotMakeNewDecisions(false);
					}
				}
			}

			// Token: 0x06005208 RID: 21000 RVA: 0x0017539C File Offset: 0x0017359C
			private void SuccessConsequences()
			{
				if (this._destroyedPartyCount == this._totalPartyCount)
				{
					base.AddLog(this._successQuestLogText1, false);
				}
				else if (this._recruitedPartyCount != 0 && this._recruitedPartyCount < this._totalPartyCount)
				{
					base.AddLog(this._successQuestLogText2, false);
				}
				else
				{
					base.AddLog(this._successQuestLogText3, false);
				}
				this.RelationshipChangeWithQuestGiver = 3;
				GiveGoldAction.ApplyBetweenCharacters(null, Hero.MainHero, this.RewardGold, false);
				if (base.QuestGiver.CurrentSettlement.IsVillage && base.QuestGiver.CurrentSettlement.Village.TradeBound != null)
				{
					base.QuestGiver.CurrentSettlement.Village.Bound.Town.Security += 5f;
					base.QuestGiver.CurrentSettlement.Village.Bound.Town.Prosperity += 5f;
				}
				else if (base.QuestGiver.CurrentSettlement.IsTown)
				{
					base.QuestGiver.CurrentSettlement.Town.Security += 5f;
					base.QuestGiver.CurrentSettlement.Town.Prosperity += 5f;
				}
				Hero.MainHero.Clan.AddRenown(1f, true);
				base.CompleteQuestWithSuccess();
			}

			// Token: 0x06005209 RID: 21001 RVA: 0x00175504 File Offset: 0x00173704
			protected override void OnTimedOut()
			{
				this.RelationshipChangeWithQuestGiver = -5;
				if (base.QuestGiver.CurrentSettlement.IsVillage)
				{
					base.QuestGiver.CurrentSettlement.Village.Bound.Town.Prosperity -= 10f;
				}
				else if (base.QuestGiver.CurrentSettlement.IsTown)
				{
					base.QuestGiver.CurrentSettlement.Town.Prosperity -= 10f;
				}
				base.AddLog(this._timeoutLog, false);
			}

			// Token: 0x0600520A RID: 21002 RVA: 0x00175599 File Offset: 0x00173799
			protected override void InitializeQuestOnGameLoad()
			{
				this.SetDialogs();
			}

			// Token: 0x0600520B RID: 21003 RVA: 0x001755A4 File Offset: 0x001737A4
			protected override void OnFinalize()
			{
				foreach (MobileParty mobileParty in this._validPartiesList)
				{
					mobileParty.Ai.SetDoNotMakeNewDecisions(false);
					mobileParty.IgnoreForHours(0f);
					if (base.IsTracked(mobileParty))
					{
						base.RemoveTrackedObject(mobileParty);
					}
				}
				this._validPartiesList.Clear();
				if (this._relatedHideout != null)
				{
					Campaign.Current.BusyHideouts.Remove(this._relatedHideout.Settlement);
				}
			}

			// Token: 0x04001AB7 RID: 6839
			[SaveableField(10)]
			private readonly int _totalPartyCount;

			// Token: 0x04001AB8 RID: 6840
			[SaveableField(30)]
			private int _destroyedPartyCount;

			// Token: 0x04001AB9 RID: 6841
			[SaveableField(50)]
			private int _recruitedPartyCount;

			// Token: 0x04001ABA RID: 6842
			[SaveableField(40)]
			private List<MobileParty> _validPartiesList;

			// Token: 0x04001ABB RID: 6843
			[SaveableField(70)]
			private Hideout _relatedHideout;

			// Token: 0x04001ABC RID: 6844
			[SaveableField(60)]
			private JournalLog _questProgressLogTest;
		}

		// Token: 0x0200065D RID: 1629
		public class MerchantNeedsHelpWithOutlawsIssueTypeDefiner : SaveableTypeDefiner
		{
			// Token: 0x06005210 RID: 21008 RVA: 0x00175684 File Offset: 0x00173884
			public MerchantNeedsHelpWithOutlawsIssueTypeDefiner() : base(590000)
			{
			}

			// Token: 0x06005211 RID: 21009 RVA: 0x00175691 File Offset: 0x00173891
			protected override void DefineClassTypes()
			{
				base.AddClassDefinition(typeof(MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssue), 1, null);
				base.AddClassDefinition(typeof(MerchantNeedsHelpWithOutlawsIssueQuestBehavior.MerchantNeedsHelpWithOutlawsIssueQuest), 2, null);
			}
		}
	}
}
